<html>
    <head>
        
        <title>报名系统</title>
        
		<#include "_head.html"/>
		
        <style type="text/css">
	        .table th , .table td 
	        { 
				text-align: center;
				vertical-align: middle!important;
				font:"courier new";
				font-size:larger;
			}
			.main
			{
				margin-bottom: 200px;
			}
	   </style>
	   <script>
	   		$(".alert").alert()
	   </script>
    </head>
        <body background="assets/images/background.jpg">
			<#include "_mask.html" />
        	<div class = "main container">
        	<div class = "row-fluid">
            <div class="span12">
               	<h1 style="text-align: center;">信息工程学院ACM报名系统</h1>
               	<#if msg??>
               		<div align="center">
	               		<div class="alert alert-warning" align="center" style="width: 20%;">
						    <a href="#" class="close" data-dismiss="alert">
						        &times;
						    </a>
						    <strong>${msg}</strong>
						</div>
					</div>
               	</#if>
				<div class=" pagination pagination-centered">
					<#include "_paginate.html" />
					<@paginate currentPage = currentPage totalPage = totalPage actionUrl="" urlParas="${query!}"/>
				</div>

                <table class="table table-stats table-responsive table-hover table-striped">
                	<thead class="">
	                    <tr>
	                        <th>
	                      		比赛
	                        </th>
	                        <th>
	                      		开始时间
	                        </th>
	                        <th>
								结束时间
	                        </th>
	                        <th>
								状态
	                        </th>
	                        <th>
								操作
	                        </th>
	                    </tr>
	                </thead>
                    <tbody>
	                    <#list NodeList as contestlist>
	                    <tr> 
	                        <td>
	                            ${contestlist.title}
	                        </td>
	                        <td>
	                            ${(contestlist.startTime*1000)?number_to_datetime}
	                        </td>
	                        <td>
	                            ${(contestlist.endTime*1000)?number_to_datetime}
	                        </td>
	                        <#if .now?long < (contestlist.startTime - 24*60*60) *1000  >
	                        	<td>
	                        		<font color="green">等待</font>
	                        	</td>
	                        	<td>
	                            	<a class = 'btn btn-info' href = "contest/show/${contestlist.cid}">进入报名列表</a>
	                           	</td>
							<#elseif .now?long < contestlist.startTime*1000>
								<td>
									<font color="blue">报名结束</font>
								</td>
								<td>
									<a class = 'btn btn-info' href = "contest/show/${contestlist.cid}">查看报名列表</a>
								</td>
	                        <#elseif .now?long < contestlist.endTime*1000>
	                        	<td>
	                        		<font color="red">正在进行</font>
	                        	</td>
	                        	<td>
	                           		<a class = 'btn btn-danger' href = "https://www.oj.swust.edu.cn/contest/show/${contestlist.cid}">进入比赛</a>
	                        	</td>
	                        <#else>
	                        	<td>
	                        		<font color=#666>结束</font>
	                        	</td>
	                        	<td>
	                           		<a class = 'btn btn-success' href = "https://www.oj.swust.edu.cn/contest/rank/${contestlist.cid}">查看比赛结果</a>
	                        	</td>
	                        </#if> 
	                    </tr>
	                    </#list>
	            	</tbody>
                </table>
            </div>
            </div>
            </div>

			<#include "_modal.html"/>
        </body>
</html>
